/*
 *  mission.cpp
 *  SpaceSim
 *
 *  Created by Tim Baanen on 2/22/11.
 *  Copyright 2011 Troi. All rights reserved.
 *
 */

#include <sstream>

#include "mission.h"

template <class T>
inline std::string toString (const T& t) {
	std::stringstream str;
	str << t;
	return str.str();
}

Mission::Mission() {
	TargetCluster = Main::CurrentCluster.GetID();
	TargetSystem = Random::Rand(1, Main::CurrentCluster.GetSystemCount() - 1);	// no cluster hubs
	System *Target = Main::CurrentCluster.GetSystem(TargetSystem);
	TargetPlanet = Random::Rand(1, Target->GetPlanetAmount()-1);	// or warp launchers
	Desc = "Deliver this to planet #" + toString(TargetPlanet + 1) + " in system " + Target->GetName() + " in cluster " + toString(TargetCluster);
	int reward = (int) Random::NormalRand(500.f, 1000.f);
	Reward = reward;
}